//
//  YMJCollectionViewCell.m
//  QQ12星座
//
//  Created by dllo on 16/7/25.
//  Copyright © 2016年 YMJ. All rights reserved.
//

#import "YMJCollectionViewCell.h"

@implementation YMJCollectionViewCell
- (instancetype)initWithFrame:(CGRect)frame {
    if (self = [super initWithFrame:frame]) {
        UIImageView *view = [[UIImageView alloc] initWithFrame:self.contentView.frame];
        view.layer.cornerRadius = 15;
        view.layer.borderWidth = 2;
        view.layer.borderColor = [UIColor colorWithRed:(arc4random() % 256) / 255.0 green:(arc4random() % 256) / 255.0 blue:(arc4random() % 256) / 255.0 alpha:1].CGColor;
        view.layer.masksToBounds = YES;
        [self.contentView addSubview:view];
        view.backgroundColor = [UIColor whiteColor];
        self.label = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, self.contentView.frame.size.width, 30)];
        [view addSubview:_label];
        _label.textAlignment = 1;
        _label.backgroundColor = [UIColor whiteColor];
        self.imageView = [[UIImageView alloc]initWithFrame:CGRectMake(0, 0, self.contentView.frame.size.width - 20, self.contentView.frame.size.width - 20)];
        self.imageView.center = self.contentView.center;
        self.imageView.layer.cornerRadius = (self.imageView.frame.size.width )/ 2;
        self.imageView.layer.masksToBounds = YES;
        [view addSubview:_imageView];
        self.dateLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, self.contentView.frame.size.height / 2 + (self.contentView.frame.size.width - 20) / 2, self.contentView.frame.size.width, 30)];
        [view addSubview:_dateLabel];
        _dateLabel.textAlignment = 1;
        _dateLabel.font = [UIFont systemFontOfSize:15];
       
        
    }
    return self;
}
@end
